package com.tsingteng.cosfun.ui.costar;

import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tsingteng.cosfun.R;
import com.tsingteng.cosfun.bean.VideoMusicBean;
import com.tsingteng.cosfun.utils.ImageUtils;
import com.tsingteng.cosfun.utils.ImageViewUtils;

/**
 * 描述 :
 * 创建人: 肖利.
 * 时间:2018/8/27
 * qq(872179966)
 */

public class VideoMusicAdapter extends BaseQuickAdapter<VideoMusicBean,BaseViewHolder> {
    public VideoMusicAdapter() {
        super(R.layout.item_adapter_video_music);
    }

    @Override
    protected void convert(BaseViewHolder helper, VideoMusicBean item) {
        ImageView picHeader = helper.getView(R.id.iv_music_pic);
        TextView musicName = helper.getView(R.id.tv_music_name);
        TextView musicDes = helper.getView(R.id.tv_music_des);
        TextView musciBg = helper.getView(R.id.tv_music_bg);
        ImageView musicSelect = helper.getView(R.id.iv_select);
        ImageUtils.LoadImage(mContext,item.getMusicImg(),picHeader,R.drawable.music_list_pic);
        musicName.setText(item.getMusicName());
        musicDes.setText(item.getDescription());
        if (item.isSelect()) {
            musicSelect.setVisibility(View.VISIBLE);
            musciBg.setVisibility(View.VISIBLE);
        }else {
            musicSelect.setVisibility(View.INVISIBLE);
            musciBg.setVisibility(View.INVISIBLE);
        }
    }
}
